//
//  MyViewController.m
//  YouMin_iOS
//
//  Created by lanou3g on 15/12/9.
//  Copyright © 2015年 wey. All rights reserved.
//

#import "MyViewController.h"
#import "MyTableViewCell.h"
@interface MyViewController () <UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, strong) NSArray *titles;
@property (nonatomic, strong) NSArray *images;
@end

@implementation MyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self loadData];
}
/** 加载表格数据 */
- (void)loadData {
    self.titles = @[@"item1", @"item2", @"item3"];
    self.images = @[placeHolder, placeHolder, placeHolder];
    self.tableView.rowHeight = 60.0;
    self.iconView.image = [UIImage imageNamed:placeHolder];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)leftMenuAction:(id)sender {
    [self.sideMenuViewController presentLeftMenuViewController];
}

#pragma mark --- tableView 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return self.titles.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    MyTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myCellID" forIndexPath:indexPath];
    cell.iconView.image = [UIImage imageNamed:self.images[indexPath.row]];
    cell.titleLabel.text = self.titles[indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}


@end
